package com.java.comprehensive.design.building_modelling.builder_pattern.other;

public class BuilderPatternDemo {
	public static void main(String[] args) {
		/*MealBuilder mealBuilder = new MealBuilder();

		Meal vegMeal = mealBuilder.prepareVegMeal();
		System.out.println("Veg Meal");
		vegMeal.showItems();
		System.out.println("Total Cost: " + vegMeal.getCost());

		Meal nonVegMeal = mealBuilder.prepareNonVegMeal();
		System.out.println("\n\nNon-Veg Meal");
		nonVegMeal.showItems();
		System.out.println("Total Cost: " + nonVegMeal.getCost());
		*/
		computerTest();
	}

	public static void computerTest() {
		ComputerDirector director = new ComputerDirector();// 1
		ComputerBuilder builder = new MacComputerBuilder("I5处理器", "三星125");// 2
		director.makeComputer(builder);// 3
		Computer macComputer = builder.getComputer();// 4
		System.out.println("mac computer:" + macComputer.toString());


		ComputerBuilder lenovoBuilder = new LenovoComputerBuilder("I7处理器", "海力士222");
		director.makeComputer(lenovoBuilder);
		Computer lenovoComputer = lenovoBuilder.getComputer();
		System.out.println("lenovo computer:" + lenovoComputer.toString());
	}
}